﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DANGQUYNHTRANG.Programming.Part03.BT01
{
    public partial class Form1 : Form
    {
        private void print(STUDENT obj, string number)
        {
            listBox1.Items.Add("--------------Sinh Viên " + number + "-----------------------");
            listBox1.Items.Add("Mã SV: " + obj.studentID);
            listBox1.Items.Add("Họ và tên: " + obj.name);
            listBox1.Items.Add("Email: " + obj.email);
            listBox1.Items.Add("Phone: " + obj.phone);
        }

        public Form1()
        {
            InitializeComponent();

            STUDENT sv01 = new STUDENT("SV01", "Hoàng Văn Thanh");
            STUDENT sv02 = new STUDENT("SV02", "Phạm Thị Thùy Linh");
            STUDENT sv03 = new STUDENT("SV03", "Trần Văn Hiếu");
            STUDENT sv04 = new STUDENT("SV04", "Nguyễn Văn Hùng");

            //Print student list
            print(sv01, "01");
            print(sv02, "02");
            print(sv03, "03");
            print(sv04, "04");

            //Update infomation
            sv01.email = "thanhhv@gmail.com";
            sv01.phone = "0988 123 456";

            sv02.email = "linhptt@gmail.com";
            sv02.phone = "0988 123 457";

            sv03.email = "hieutv@gmail.com";
            sv03.phone = "0988 123 458";

            sv04.email = "hungnv@gmail.com";
            sv04.phone = "0988 123 459";

            //Print student list
            print(sv01, "01(Updated)");
            print(sv02, "02(Updated)");
            print(sv03, "03(Updated)");
            print(sv04, "04(Updated)");

        }
        public void Form1_LOAD(object sender, EventArgs e)
        {
            
        }
    }
}
